﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>用户套餐管理</title>
    <link href="~/plugins/layui/css/layui.css" rel="stylesheet" />
</head>
<body style="margin-left:10px;margin-top:10px;">
    <div id="ss" class="layui-form-item layui-hide">
        <input type="text" name="usergid" class="layui-hide" value="@Request.QueryString["usergid"]" />
        <div class="layui-inline">
            <div class="layui-input-inline" style="width: 30px;">
                <i class="layui-icon" style="font-size: 30px; color: #1E9FFF;">&#xe615;</i>
            </div>
            <div class="layui-input-inline layui-form layui-form-pane">
                <select name="flgid">
                    <option value="0" selected="">= 全部 =</option>
                    @foreach (var item in @ViewBag.cpfl)
                    {
                        if (@item.gid == @ViewBag.flgid)
                        {
                            <option value="@item.gid" selected="">@item.name</option>
                        }
                        else
                        {
                            <option value="@item.gid">@item.name</option>
                        }
                    }
                </select>
            </div>
            <div class="layui-input-inline" style="width: 150px;">
                <input type="text" placeholder="套餐名称" name="name" class="layui-input" value="@ViewBag.name" />
            </div>
            <div class="layui-input-inline layui-hide" style="width: 150px;">
                <input class="layui-input" placeholder="注册开始日期" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name="stime" value="@ViewBag.stime">
            </div>
            <div class="layui-form-mid layui-hide">-</div>
            <div class="layui-input-inline layui-hide" style="width: 150px;">
                <input class="layui-input" placeholder="注册结束日期" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name="etime" value="@ViewBag.etime">
            </div>
            <div class="layui-input-inline layui-hide" style="width: 150px;">
                <input class="layui-input" placeholder="收入开始日期" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name="pstime" value="@ViewBag.pstime">
            </div>
            <div class="layui-form-mid layui-hide">-</div>
            <div class="layui-input-inline layui-hide" style="width: 150px;">
                <input class="layui-input" placeholder="收入结束日期" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" name="petime" value="@ViewBag.petime">
            </div>
            <div class="layui-input-inline">
                <a onclick="javascript: page(-1,-1);" class="layui-btn">给偶搜</a>
            </div>
        </div>
    </div>
    <div class="layui-form">
        <table class="layui-table">
            <thead>
                <tr>
                    <th>套餐名称</th>
                    <th>价格</th>
                    <th>天数</th>
                    <th>机器码要求</th>
                    <th>购买记录</th>
                </tr>
            </thead>
            <tbody id="tbody">
                <script id="tpl" type="text/html">
                    {{each list as item index}}
                <tr id="{{item.gid}}">
                    <td>{{item.name}}</td>
                    <td>
                        <input class="layui-input" style="width:50px;" type="text" value="{{item.rmb}}" /> <button class="layui-btn layui-btn-mini" onclick="setrmb('{{item.gid}}','{{item.tcgid}}');">修改</button>
                    </td>
                    <td>{{item.xfx}}</td>
                    <td>{{item.xfd=="0"?"通用":item.xfd}}</td>
                    <td>
                        <div class="layui-btn-group">
                            <button class="layui-btn layui-btn-mini @(LJSheng.Common.LCookie.Getljsheng("qx")=="管理员"?"":"layui-hide")" onclick="Showiframe('{{item.name}}','/ljsheng/ddlist?usergid={{item.usergid}}&buygid={{item.gid}}');">查看订单</button>
                        </div>
                    </td>
                </tr>
                {{/each}}
                </script>
            </tbody>
        </table>
    </div>

    <label id="gid" class="layui-hide"></label>
    <div id="page"></div>
    共 <label id="pages">0</label> 页, <label id="count">0</label> 条数据 <em style="color:red;">当前查询条件提现总金额=<label id="parame1"></label></em> <a href="javascript: daochu();" class="layui-btn">导出当前查询的数据</a>
    <label id="Controllers" class="layui-hide">tc</label>
    <script src="~/js/jquery.js"></script>
    <script src="~/plugins/layui/layui.js"></script>
    <script src="~/js/template-web.js"></script>
    <script src="~/js/list.js"></script>
    <script src="~/js/daochu.js"></script>
    <script>
        function setrmb(shopgid, tcgid) {
            $.ajax({
                url: "/ajax/api.ashx",
                data: "ff=setrmb&usergid=@Request.QueryString["usergid"]&shopgid=" + shopgid + "&tcgid=" + tcgid + "&rmb=" + $("#" + shopgid + " td").children("input").val() + "&Cache=" + Math.random(),
                type: "post",
                cache: false,
                timeout: 8000,
                dataType: "json",
                ContentType: "application/json; charset=utf-8",
                error: function () { layer.msg("请求超时"); },
                beforeSend: function () { },
                success: function (data) {
                    layer.msg(data.data, { icon: 1 });
                },
            });
        }
    </script>
</body>
</html>
